package com.tony.controller;

import com.tony.pojo.Account;
import com.tony.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/account")
public class AccountController {

    @Autowired
    AccountService service;

    @RequestMapping("/t1/{id}")
    public String test1(@PathVariable("id") int id, Model model){
        Account byID = service.findByID(id);
        model.addAttribute("account",byID);
        return "account";
    }

}
